From: Sebastian Keller Date: Wed, 28 Apr 2021 05:13:35 +0000 (+0200) Subject: screenshot: Only select area on button release after a button down X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~44 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=548e18ad7e9b8e2d44b9ced4b05b715e90423283;p=gnome-shell.git screenshot: Only select area on button release after a button down On Wayland it is possible to trigger area selection with a button already being down. SelectArea would then react to the subsequent button release without ever having seen a corresponding button down first, leaving the start coordinates of the selection rectangle uninitialized. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2761 Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 583f8b7c5..e736c3f6c 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -393,6 +393,9 @@ class SelectArea extends St.Widget { } vfunc_button_release_event() { + if (this._startX === -1 || this._startY === -1) + return Clutter.EVENT_PROPAGATE; + this._result = this._getGeometry(); this.ease({ opacity: 0,